/**
 * @author kahoChan
 * @date 2020/9/9
 */
public class _0909_132模式 {

    public boolean find132pattern(int[] nums) {
        if (nums.length < 3) {
            return false;
        }
        for (int i = 0; i < nums.length-1; i++) {
            int max = Integer.MIN_VALUE;
            for (int j = i+1; j < nums.length-1; j++){
                if (max < nums[j]){
                    max = nums[j];
                }
                if (nums[i]<max && nums[i]< nums[j] && max> nums[j]){
                    return true;
                }
            }
        }
        return false;
    }
}
